
const {ccclass, property} = cc._decorator;

@ccclass
export default class PlayerStorageManager  
{
    static _instance:PlayerStorageManager;

    static get Instance()
    {
        return this._instance || (this._instance = new PlayerStorageManager());
    }

    dic:{[key:string]:any;}  = {};

    setStorage( itemName:string,itemValue:any)
    {
        cc.sys.localStorage.setItem(itemName,itemValue);
        this.dic[itemName] = itemValue;
    }

    getStorage( itemName:string):any
    {
        if(this.dic[itemName] == null ||this.dic[itemName] == undefined ) 
        {
            this.dic[itemName]  = cc.sys.localStorage.getItem(itemName);
        }
        return   this.dic[itemName];
    }


}

export class PlayerStorage
{
    static MusicOpen = "MusicOpen";
    static EffectOpen = "EffectOpen";

    static CardNotice = "CardNotice";//出牌提示
}
